package com.it.myd.service.main.module.world;

import com.it.myd.bean.box.world.Resource;
import com.it.myd.dao.main.module.world.ResourceDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ResourceServiceImpl implements ResourceService{
    @Autowired
    private ResourceDao resourceDao;

    private List<Resource> reslist;

    public void setReslist(List<Resource> reslist) {
        this.reslist = reslist;
    }

    public List<Resource> getReslist() {
        return reslist;
    }
    @Override
    public void addResource(Resource res) {
        resourceDao.saveResourceObj(res);
        resourceDao.saveResourceHis(res);
    }

    @Override
    public void updateResource(Resource res) {
        resourceDao.updateResourceObj(res);
        resourceDao.saveResourceHis(res);
    }

    @Override
    public List<Resource> getResourceIsExist() {
        return resourceDao.getResourceIsExist();
    }

}
